package com.towker.core.util;

import java.util.ArrayList;
import java.util.List;

public class CollectionUtil
{
	public static Long[] toLongArray(long[] array)
	{
		Long[] arr = new Long[array.length];
		for(int i = 0; i < array.length; i++)
		{
			arr[i] = new Long(array[i]);
		}
		return arr;
	}
	public static Integer[] toIntegerArray(int[] array)
	{
		Integer[] arr = new Integer[array.length];
		for(int i = 0; i < array.length; i++)
		{
			arr[i] = new Integer(array[i]);
		}
		return arr;
	}
	public static Float[] toFloatArray(float[] array)
	{
		Float[] arr = new Float[array.length];
		for(int i = 0; i < array.length; i++)
		{
			arr[i] = new Float(array[i]);
		}
		return arr;
	}
	
	/**
	 * 字符串数组转换成为长整型列表。
	 */
	public static List<Long> strArrToLngList(String[] arr)
	{
		List<Long> list = new ArrayList<Long>();
		if (arr == null || arr.length == 0)
		{
			return null;
		}
		for (int i = 0; i < arr.length; i++)
		{
			Long tmp = Long.parseLong(arr[i]);
			list.add(tmp);
		}
		return list;
	}
}
